package com.hsb.seckill.service.impl;

import com.hsb.seckill.dao.GoodsDao;
import com.hsb.seckill.entity.User;
import com.hsb.seckill.service.GoodsService;
import com.hsb.seckill.vo.GoodsVo;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Goods)表服务实现类
 *
 * @author makejava
 * @since 2021-09-05 21:56:51
 */
@Service("goodsService")
public class GoodsServiceImpl implements GoodsService {
    @Resource
    private GoodsDao goodsDao;

    /**
     * 查询所有秒杀商品
     * @return
     */
    @Override
    public List<GoodsVo> querySeckillGoods() {
        List<GoodsVo> goodsList = goodsDao.querySeckillGoods();
        return goodsList;
    }

    /**
     * 根据商品id商品
     * @param goodsId
     * @return
     */
    @Override
    public GoodsVo querySeckillGoodsById(long goodsId) {
        GoodsVo goods = goodsDao.querySeckillGoodsById(goodsId);
        return goods;
    }
}